import { assert, assertRejects } from '@std/assert';
import { FakeTime } from '@std/testing/time';

import { verifyAttestationAndroidSafetyNet } from './verifyAttestationAndroidSafetyNet.ts';

import type { RegistrationResponseJSON } from '../../types/index.ts';
import { decodeAttestationObject } from '../../helpers/decodeAttestationObject.ts';
import { parseAuthenticatorData } from '../../helpers/parseAuthenticatorData.ts';
import { toHash } from '../../helpers/toHash.ts';
import { isoBase64URL } from '../../helpers/iso/index.ts';
import { SettingsService } from '../../services/settingsService.ts';

const rootCertificates = SettingsService.getRootCertificates({
  identifier: 'android-safetynet',
});

/**
 * Parse the responses below for values needed in each test
 */
async function getResponseValues(response: RegistrationResponseJSON) {
  const { attestationObject, clientDataJSON } = response.response;
  const decodedAttestationObject = decodeAttestationObject(
    isoBase64URL.toBuffer(attestationObject),
  );

  const authData = decodedAttestationObject.get('authData');
  const attStmt = decodedAttestationObject.get('attStmt');
  const clientDataHash = await toHash(isoBase64URL.toBuffer(clientDataJSON));

  const parsedAuthData = parseAuthenticatorData(authData);
  const aaguid = parsedAuthData.aaguid!;
  const credentialID = parsedAuthData.credentialID!;
  const credentialPublicKey = parsedAuthData.credentialPublicKey!;
  const rpIdHash = parsedAuthData.rpIdHash;

  return {
    authData,
    attStmt,
    clientDataHash,
    parsedAuthData,
    aaguid,
    credentialID,
    credentialPublicKey,
    rpIdHash,
  };
}

/**
 * We need to use the `verifyTimestampMS` escape hatch until I can figure out
 * how to generate a signature after modifying the payload with a `timestampMs`
 * we can dynamically set
 */
Deno.test('should verify Android SafetyNet attestation', async () => {
  const {
    attStmt,
    authData,
    clientDataHash,
    aaguid,
    credentialID,
    credentialPublicKey,
    rpIdHash,
  } = await getResponseValues(attestationAndroidSafetyNet);

  // Faking time to something that'll satisfy all of these ranges:
  // {
  //   notBefore: 2018-10-10T07:19:45.000Z,
  //   notAfter: 2019-10-09T07:19:45.000Z
  // }
  // {
  //   notBefore: 2017-06-15T00:00:42.000Z,
  //   notAfter: 2021-12-15T00:00:42.000Z
  // }
  // {
  //   notBefore: 1998-09-01T12:00:00.000Z,
  //   notAfter: 2028-01-28T12:00:00.000Z
  // }
  const mockDate = new FakeTime(new Date('2019-10-01T00:00:42.000Z'));

  const verified = await verifyAttestationAndroidSafetyNet({
    attStmt,
    authData,
    clientDataHash,
    verifyTimestampMS: false,
    aaguid,
    rootCertificates: [...rootCertificates, GlobalSign_R2],
    credentialID,
    credentialPublicKey,
    rpIdHash,
  });

  assert(verified);

  mockDate.restore();
});

Deno.test('should throw error when timestamp is not within one minute of now', async () => {
  const {
    attStmt,
    authData,
    clientDataHash,
    aaguid,
    credentialID,
    credentialPublicKey,
    rpIdHash,
  } = await getResponseValues(attestationAndroidSafetyNet);

  await assertRejects(
    () =>
      verifyAttestationAndroidSafetyNet({
        attStmt,
        authData,
        clientDataHash,
        aaguid,
        rootCertificates,
        credentialID,
        credentialPublicKey,
        rpIdHash,
      }),
    Error,
    'has expired',
  );
});

Deno.test('should reject when a revoked certificate is found', async () => {
  const {
    aaguid,
    attStmt,
    authData,
    clientDataHash,
    credentialID,
    credentialPublicKey,
    rpIdHash,
  } = await getResponseValues(safetyNetUsingGSR1RootCert);

  // Faking time to something that'll satisfy all of these ranges:
  // {
  //   notBefore: 2021-07-19T13:13:42.000Z,
  //   notAfter: 2021-10-17T13:13:41.000Z
  // }
  // {
  //   notBefore: 2020-08-13T00:00:42.000Z,
  //   notAfter: 2027-09-30T00:00:42.000Z
  // }
  // {
  //   notBefore: 2020-06-19T00:00:42.000Z,
  //   notAfter: 2028-01-28T00:00:42.000Z
  // }
  // {
  //   notBefore: 1998-09-01T12:00:00.000Z,
  //   notAfter: 2028-01-28T12:00:00.000Z
  // }
  const mockDate = new FakeTime(new Date('2021-10-15T00:00:42.000Z'));

  await assertRejects(
    () =>
      verifyAttestationAndroidSafetyNet({
        attStmt,
        authData,
        clientDataHash,
        verifyTimestampMS: false,
        aaguid,
        rootCertificates,
        credentialID,
        credentialPublicKey,
        rpIdHash,
      }),
    Error,
    'revoked certificate',
  );

  mockDate.restore();
});

const attestationAndroidSafetyNet: RegistrationResponseJSON = {
  id: 'AQy9gSmVYQXGuzd492rA2qEqwN7SYE_xOCjduU4QVagRwnX30mbfW75Lu4TwXHe-gc1O2PnJF7JVJA9dyJm83Xs',
  rawId: 'AQy9gSmVYQXGuzd492rA2qEqwN7SYE_xOCjduU4QVagRwnX30mbfW75Lu4TwXHe-gc1O2PnJF7JVJA9dyJm83Xs',
  response: {
    attestationObject: 'o2NmbXRxYW5kcm9pZC1zYWZldHluZXRnYXR0U3RtdKJjdmVyaDE3MTIyMDM3aHJlc' +
      '3BvbnNlWRS9ZXlKaGJHY2lPaUpTVXpJMU5pSXNJbmcxWXlJNld5Sk5TVWxHYTJwRFEwSkljV2RCZDBsQ1FXZEpVV' +
      'kpZY205T01GcFBaRkpyUWtGQlFVRkJRVkIxYm5wQlRrSm5hM0ZvYTJsSE9YY3dRa0ZSYzBaQlJFSkRUVkZ6ZDBOU' +
      'ldVUldVVkZIUlhkS1ZsVjZSV1ZOUW5kSFFURlZSVU5vVFZaU01qbDJXako0YkVsR1VubGtXRTR3U1VaT2JHTnVXb' +
      'kJaTWxaNlRWSk5kMFZSV1VSV1VWRkVSWGR3U0ZaR1RXZFJNRVZuVFZVNGVFMUNORmhFVkVVMFRWUkJlRTFFUVROT' +
      'lZHc3dUbFp2V0VSVVJUVk5WRUYzVDFSQk0wMVVhekJPVm05M1lrUkZURTFCYTBkQk1WVkZRbWhOUTFaV1RYaEZla' +
      '0ZTUW1kT1ZrSkJaMVJEYTA1b1lrZHNiV0l6U25WaFYwVjRSbXBCVlVKblRsWkNRV05VUkZVeGRtUlhOVEJaVjJ4M' +
      'VNVWmFjRnBZWTNoRmVrRlNRbWRPVmtKQmIxUkRhMlIyWWpKa2MxcFRRazFVUlUxNFIzcEJXa0puVGxaQ1FVMVVSV' +
      'zFHTUdSSFZucGtRelZvWW0xU2VXSXliR3RNYlU1MllsUkRRMEZUU1hkRVVWbEtTMjlhU1doMlkwNUJVVVZDU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FZVGgxTEU2VVZwaU1lZWFidDdUeWJ3dzdXZk42RzJ5R01tZ' +
      'kVjbTFabjRWalZkenpoY1BqTS1WR052aWl1RGxyZ2VuWEViZ082V05YNlYzc0hHVjN1VGxGMlBuOUZsY3YxWmItS' +
      '2NGVHZUd29iYnY3LUp5VUZzTlhTSnhHZFRTOWxwNU5EdDFnWGJ6OVpORWhzVXI3ajBqbWNyaU9rR29PRzM4MXRSa' +
      '0Vqdk5aa0hpMkF1UDF2MWM4RXg3cEpZc09ISzJxaDlmSHFuSlAzcGowUFc3WThpcDBSTVZaNF9xZzFqc0dMMnZ0O' +
      'G12cEJFMjg5dE1fcnROdm94TWU2aEx0Q1ZkdE9ZRjIzMWMtWVFJd2FEbnZWdDcwYW5XLUZYdUx3R1J5dWhfRlpNM' +
      '3FCSlhhcXdCNjNITk5uMmh5MFRDdHQ4RDdIMmI4MGltWkZRX1FoYXV0aERhdGFYxT3cRxDpwIiyKduonVYyILs59' +
      'yKa_0ZbCmVrGvuaivigRQAAAAC5P9lh8uZGL7EiggAiR954AEEBDL2BKZVhBca7N3j3asDaoSrA3tJgT_E4KN25T' +
      'hBVqBHCdffSZt9bvku7hPBcd76BzU7Y-ckXslUkD13Imbzde6UBAgMmIAEhWCCT4hId3ByJ_agRyznv1xIazx2nl' +
      'VEGyvN7intoZr7C2CJYIKo3XB-cca9aUOLC-xhp3GfhyfTS0hjws5zL_bT_N1AL',
    clientDataJSON: 'eyJ0eXBlIjoid2ViYXV0aG4uY3JlYXRlIiwiY2hhbGxlbmdlIjoiWDNaV1VHOUZOREpF' +
      'YUMxM2F6Tmlka2h0WVd0MGFWWjJSVmxETFV4M1FsZyIsIm9yaWdpbiI6Imh0dHBzOlwvXC9kZXYuZG9udG5lZWRh' +
      'LnB3IiwiYW5kcm9pZFBhY2thZ2VOYW1lIjoiY29tLmFuZHJvaWQuY2hyb21lIn0',
  },
  clientExtensionResults: {},
  type: 'public-key',
};

const safetyNetUsingGSR1RootCert: RegistrationResponseJSON = {
  id: 'AQsMmnEQ8OxpZxijXBMT4tyamgkqC_3hr18_e8KeK8nG69ijcTaXNKX_CRmYiW0fegPE0N_3NVHEaj_kit7LPNM',
  rawId: 'AQsMmnEQ8OxpZxijXBMT4tyamgkqC_3hr18_e8KeK8nG69ijcTaXNKX_CRmYiW0fegPE0N_3NVHEaj_kit7LPNM',
  response: {
    attestationObject:
      'o2NmbXRxYW5kcm9pZC1zYWZldHluZXRnYXR0U3RtdKJjdmVyaTIxMjQxODA0NmhyZXNwb25zZVkgcmV5SmhiR2Np' +
      'T2lKU1V6STFOaUlzSW5nMVl5STZXeUpOU1VsR1dIcERRMEpGWldkQmQwbENRV2RKVVdadE9HbFpXbnAxY1RCRlNr' +
      'RkJRVUZCU0RkMVVsUkJUa0puYTNGb2EybEhPWGN3UWtGUmMwWkJSRUpIVFZGemQwTlJXVVJXVVZGSFJYZEtWbFY2' +
      'UldsTlEwRkhRVEZWUlVOb1RWcFNNamwyV2pKNGJFbEdVbmxrV0U0d1NVWk9iR051V25CWk1sWjZTVVY0VFZGNlJW' +
      'Uk5Ra1ZIUVRGVlJVRjRUVXRTTVZKVVNVVk9Ra2xFUmtWT1JFRmxSbmN3ZVUxVVFUTk5WR3Q0VFhwRmVrNUVTbUZH' +
      'ZHpCNVRWUkZkMDFVWTNoTmVrVjZUa1JHWVUxQ01IaEhla0ZhUW1kT1ZrSkJUVlJGYlVZd1pFZFdlbVJETldoaWJW' +
      'SjVZakpzYTB4dFRuWmlWRU5EUVZOSmQwUlJXVXBMYjFwSmFIWmpUa0ZSUlVKQ1VVRkVaMmRGVUVGRVEwTkJVVzlE' +
      'WjJkRlFrRkxaazVUUWxsNE0wMDJTbkpKYVRCTVVVUkdORlZhYUhSemVUZ3lRMjgwVG5aM2NpOUdTVzQzTHpsbksz' +
      'aHpWM3BEV1dkU04xRnpSMjF5ZVVjNWRsQkdja2Q1VVhKRlpHcERVWFZDVTFGVGQyOXZOR2R3YVVocGR6RllibkZH' +
      'Wm5K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lRWhNZUU5REsxWnNUakZTVGtONVMy' +
      'UlVjV1pJWWxKQlFXUk9XVmczTjBoWEwyMVFRbTVWUXpGb2NtVlVSM2hIZUZOT01VUm9hazF4Tkhwb09GQkRiVEI2' +
      'TDNKQ00zQkVkMmxuYldsTmRtRllVRVZFYXpaRWJHbE5VMFY1WkRCak5ua3dPV2cxVjA1WFRpOWplR3BITDNWUk1E' +
      'SjZSRU12UldrdlptUkZaM1V5TVVobmVITTNRMFZVZFROMFpUWkNiekZTZUM5NFIxRnRLMnRvTlhZd2NIWXJhVmw2' +
      'Y25oVmJFOHZUV1J2YjJsa2VqbENRMWhYT0haeVRVbzJVbk5SVmxKUWVUUjVSbGN2TXpjeU4yeDFSRnBaTUVoME5X' +
      'MUZSa2xLUTNCV1EybENUSE5wZURCd2JWUnNhMXBhZFhSRWFDOHZUV1JOTlVFME56RldRVU14VTBsNGVrTXpUMkYw' +
      'ZEZoV1RGTnRTWFpuZDFoWFlsbzVhekpzZWtwcGVrRnNiRkpMVld0TlRGUmtjMDlFY0RVek0yNVBhMlJXVTFvMlpp' +
      'dEljbkZKYzFSTVRuTTFVVk5MWWtVMGNuaHlkbFpPS3pROUlpd2lUVWxKUm1wRVEwTkJNMU5uUVhkSlFrRm5TVTVC' +
      'WjBOUGMyZEplazV0VjB4YVRUTmliWHBCVGtKbmEzRm9hMmxIT1hjd1FrRlJjMFpCUkVKSVRWRnpkME5SV1VSV1VW' +
      'RkhSWGRLVmxWNlJXbE5RMEZIUVRGVlJVTm9UVnBTTWpsMldqSjRiRWxHVW5sa1dFNHdTVVpPYkdOdVduQlpNbFo2' +
      'U1VWNFRWRjZSVlZOUWtsSFFURlZSVUY0VFV4U01WSlVTVVpLZG1JelVXZFZha1YzU0doalRrMXFRWGRQUkVWNlRV' +
      'UkJkMDFFVVhsWGFHTk9UV3BqZDA5VVRYZE5SRUYzVFVSUmVWZHFRa2ROVVhOM1ExRlpSRlpSVVVkRmQwcFdWWHBG' +
      'YVUxRFFVZEJ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JhU3l0WWFETkpNSFJ4U25reWNt' +
      'ZFBjVTVFWm14eU5VbE5VVGhhVkZkQk0zbHNkR0ZyZWxOQ1MxbzJXSEJHTUZCd2NYbERVblp3TDA1RFIzWXlTMWd5' +
      'VkhWUVEwcDJjMk53TVM5dE1uQldWSFI1UW1wWlVGSlJLMUYxUTFGSFFVcExhblJPTjFJMVJFWnlabFJ4VFZkMldX' +
      'ZFdiSEJEU2tKcmQyeDFOeXMzUzFrelkxUkpabnBGTjJOdFFVeHphMDFMVGt4MVJIb3JVbnBEWTNOWlZITldZVlUz' +
      'Vm5BemVFdzJNRTlaYUhGR2EzVkJUMDk0UkZvMmNFaFBhamtyVDBwdFdXZFFiVTlVTkZnekt6ZE1OVEZtV0VwNVVr' +
      'ZzVTMlpNVWxBMmJsUXpNVVExYm0xelIwRlBaMW95Tmk4NFZEbG9jMEpYTVhWdk9XcDFOV1phVEZwWVZsWlROVWd3' +
      'U0hsSlFrMUZTM2xIVFVsUWFFWlhjbXgwTDJoR1V6STRUakY2WVV0Sk1GcENSMFF6WjFsblJFeGlhVVJVT1daSFdI' +
      'TjBjR3NyUm0xak5HOXNWbXhYVUhwWVpUZ3hkbVJ2Ulc1R1luSTFUVEkzTWtoa1owcFhieXRYYUZRNVFsbE5NRXBw' +
      'SzNka1ZtMXVVbVptV0dkc2IwVnZiSFZVVG1OWGVtTTBNV1JHY0dkS2RUaG1Sak5NUnpCbmJESnBZbE5aYVVOcE9X' +
      'RTJhSFpWTUZSd2NHcEtlVWxYV0doclNsUmpUVXBzVUhKWGVERldlWFJGVlVkeVdESnNNRXBFZDFKcVZ5ODJOVFp5' +
      'TUV0V1FqQXllRWhTUzNadE1scExTVEF6Vkdkc1RFbHdiVlpEU3pOclFrdHJTMDV3UWs1clJuUTRjbWhoWm1ORFMw' +
      'OWlPVXA0THpsMGNFNUdiRkZVYkRkQ016bHlTbXhLVjJ0U01UZFJibHB4Vm5CMFJtVlFSazlTYjFwdFJucE5QU0lz' +
      'SWsxS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RVdtdkU2RS1sYWNFQWJlRzFNZV9Ib1JkS2tkMktYbWpkMU5lOWx4ampuRUZWZFJwaUt5' +
      'T1F0bFMyR2RnQnZRWEVoWEM1WDlBdDA0WGFyQkctVHlpOUNhX2lTLXRiNV9rcXNqYmFjVWRqSTN4RUI5YVdQTHF5' +
      'M3lPX3JFM1JFTDZIVlU5bE9XQWtfbE5qdkozU3dXQkthNVZwVDZOclZuMEp1UkFuZ2tYVmRjS1JlaVpKbFdaNW9j' +
      'V1l4ajgxY2ZYX2xPR29FM3ozZEtheG44U0ZNNTlVLTVUQm5Gdl9NTzBFRVUwVXJpSDhmQlp6UmdGSHFoUlNvRGs2' +
      'UmF1aUh0a0JjZjhRVkJ4TURwVXdFd25qOWc0OUVLSkFwVWtqcjZxcFpxdXRfcFBBaGF1dGhEYXRhWMVJlg3liA6M' +
      'aHQ0Fw9kdmBbj-SuuaKGMseZXPO6gx2XY0UAAAAAuT_ZYfLmRi-xIoIAIkfeeABBAQsMmnEQ8OxpZxijXBMT4tya' +
      'mgkqC_3hr18_e8KeK8nG69ijcTaXNKX_CRmYiW0fegPE0N_3NVHEaj_kit7LPNOlAQIDJiABIVggxf5sshpkLLen' +
      '92NUd9sRVM1fVR6FRFZY_P7fnCq3crgiWCALN83GhRoAD4faTpk1bp7bGclHRleO922RvPUpSnBb-w',
    clientDataJSON:
      'eyJ0eXBlIjoid2ViYXV0aG4uY3JlYXRlIiwiY2hhbGxlbmdlIjoiQUhOWlE1WWFoZVpZOF9lYXdvM0VITHlXdjhCemlqaXFzQlVlNDZ2LVFTZyIsIm9yaWdpbiI6Imh0dHA6XC9cL2xvY2FsaG9zdDo0MjAwIiwiYW5kcm9pZFBhY2thZ2VOYW1lIjoiY29tLmFuZHJvaWQuY2hyb21lIn0',
    transports: [],
  },
  type: 'public-key',
  clientExtensionResults: {},
};

/**
 * GlobalSign R2
 *
 * Downloaded from https://pki.goog/repo/certs/gsr2.pem
 *
 * EXPIRED ON 2021-12-15 @ 00:00 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